package com.gt.enums;

import com.gt.service.impl.InterfaceLogServiceImpl;
import com.gt.service.impl.WeChatRestServiceImpl;
import lombok.Getter;

/**
 * @author 许剑峰
 */

@Getter
public enum BatchPoolCallEnum {
    // 远程调用服务例子  codename:业务编码  clazz:远程调用接口类  exchangeMethodName:领券回调方法  verifyMethodName:核销回调方法
    CODE_NAME("WeChatRestServiceImpl",WeChatRestServiceImpl.class, "baseWxRest","verifyMethodName"),

    INTERFACELOG_NAME("InterfaceLogServiceImpl",InterfaceLogServiceImpl.class, "mycount","verifyMethodName"),

// 星客邮礼
//    REMOTE_XKYL_SERVICE("xkyl",RemoteXkylService.class, "notifyFavor","notifyVerify"),

    //扫码发券
//    REMOTE_SCAN_SERVICE("scan", RemoteScanService.class, "notifyFavor","notifyVerify"),
    ;
    /**
     * 业务编码（请保持唯一）
     */
    private final String code;
    /**
     * 远程调用接口类
     */
    private final Class<?> clazz;
    /**
     * 领券回调方法名
     */
    private final String method;
    /**
     * 核销回调方法名
     */
    private final String verMethod;
    BatchPoolCallEnum(String code, Class<?> clazz, String method, String verMethod) {
        this.code = code;
        this.clazz = clazz;
        this.method = method;
        this.verMethod = verMethod;
    }
    public static BatchPoolCallEnum getByCode(String code){
        for (BatchPoolCallEnum value : values()) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
